<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 数组方法 </title>
</head>
<body>
<h2>合并（连接）数组</h2>
<p>concat() 方法通过合并（连接）现有数组来创建一个新数组：</p>

<p id="demo"></p>

<script>
  var myGirls = ["Emma", "Isabella"];
  var myBoys = ["Jacob", "Michael", "Ethan"];
  var myChildren = myGirls.concat(myBoys);

  document.getElementById("demo").innerHTML = myChildren;
</script>
</body>
</html>

<!--
运行结果：Emma,Isabella,Jacob,Michael,Ethan
-->

<!--合并三个数组：var myChildren = arr1.concat(arr2, arr3);   将arr1、arr2 与 arr3 连接在一起-->